<template>
  <Field
    :border="border"
    :name="name"
    :label="label"
    :labelWidth="labelWidth"
    :disabled="disabled"
    :readonly="showType === 'view'"
    :placeholder="placeholder"
    :type="type"
    :rules="rules"
  >
    <template #input>
      <van-switch v-model="currentValue" @change="$emit('change', currentValue, name)" :size="size" />
    </template>
  </Field>
</template>

<script>
import common from './item'
import { Switch } from 'vant'
export default {
  mixins: [common],
  components: {
    vanSwitch: Switch
  },
  computed: {
    size () {
      return this.info.size || '20'
    }
  }
}
</script>
